package com.zisuyi.game.sdk.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.viewbinding.ViewBinding
import com.weilele.mvvm.base.PopupWindowDialog


/**
 * 如果需要isNeedSwitchView返回true，需要在构造函数处对PopupWindow宽和高重新赋值
 * 这个与PopupWindowDialog区别只是加入了 SwitchView
 */
abstract class BasePopupWindow<Binding:ViewBinding?> : PopupWindowDialog(), IBaseHelper, IBaseHelperView<Binding> by BaseHelperImpl() {


    final override fun getLayoutResOrView(inflater: LayoutInflater,parent: ViewGroup?): Any? {
        return getContentView(
                this,
                appCompatActivity,
                inflater,
                parent,
                true,
                isNeedToolbar(),
                isNeedBackIcon(),
                isNeedSwitchView())
    }

    override fun initUi(savedInstanceState: Bundle?) {

    }

    override fun initData() {
    }


    override fun getClickView(): List<View?>? = null


    override fun onSingleClick(view: View) {

    }

    override fun onRootViewLayoutParams(isAsDropDown: Boolean, lp: FrameLayout.LayoutParams) {
        super.onRootViewLayoutParams(isAsDropDown, lp)
    }
}